﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace _04_数据模板01_DataGrid
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent(); 
			List<Color> listColor = new List<Color>();
			listColor.Add(new Color() { Code = " #FF5151", Name = "红" });
			listColor.Add(new Color() { Code = " #005AB5", Name = "蓝" });
			listColor.Add(new Color() { Code = " #019858", Name = "绿" });
			listColor.Add(new Color() { Code = " #73BF00", Name = "深绿" });
			listColor.Add(new Color() { Code = " #D26900", Name = "橙红" });
			dataGrid.ItemsSource = listColor;



		}
	}
	public class Color
	{
		public string Code { get; set; }
		public string Name { get; set; }
	}
}

